



var upMsg={
	
	openMsg:function(text){
		$("body").append('<div id="upmessage" style="position:fixed;z-index:9999;background-color: #000000;width:50%;opacity:0.8;color: white;border-radius: 0.5rem;display: none;" ><div style="width: 100%;text-align: center"><img src="img/system.png" style="margin-top:20px;height: 40px;width: 40px" /></div><div style="margin-top:10px;white-space:normal;" id="dText">'+text+'</div></div>');
			var windowWidth = window.screen.width;
			var windowHeiht = window.screen.height;
			var modelheight=$("#upmessage").height();
			var modelwidth=$("#upmessage").width();

			var txtWidth = modelwidth-40;
			$("#dText").css("width",txtWidth+"px");
			$("#dText").css("margin-left","20px");
			$("#dText").css("margin-bottom","20px");
        	$("#dText").css("font-size","14px");
			// alert(windowWidth+"-"+modelwidth+"-"+parseInt(windowWidth-modelwidth)/2);
			var left = parseInt(windowWidth-modelwidth)/2+"px";
			// alert(left+"-"+windowWidth+"-"+modelwidth)
			$("#upmessage").css("top","15%");
			$("#upmessage").css("left",left);
			$("#upmessage").css("display","block");
			$("#upmessage").css("text-align","center");
	},
    openMsgtoPos:function(text,top){
        $("body").append('<div id="upmessage" style="position:fixed;z-index:9999;background-color: #000000;width:50%;opacity:0.8;color: white;border-radius: 0.5rem;display: none;" ><div style="width: 100%;text-align: center"><img src="img/system.png" style="margin-top:20px;height: 40px;width: 40px" /></div><div style="margin-top:10px;white-space:normal;" id="dText">'+text+'</div></div>');
        var windowWidth = window.screen.width;
        var windowHeiht = window.screen.height;
        var modelheight=$("#upmessage").height();
        var modelwidth=$("#upmessage").width();

        var txtWidth = modelwidth-40;
        $("#dText").css("width",txtWidth+"px");
        $("#dText").css("margin-left","20px");
        $("#dText").css("margin-bottom","20px");
        $("#dText").css("font-size","14px");
        // alert(windowWidth+"-"+modelwidth+"-"+parseInt(windowWidth-modelwidth)/2);
        var left = parseInt(windowWidth-modelwidth)/2+"px";
        // alert(left+"-"+windowWidth+"-"+modelwidth)
        $("#upmessage").css("top",top);
        $("#upmessage").css("left",left);
        $("#upmessage").css("display","block");
        $("#upmessage").css("text-align","center");
    },
	
		alertMsg:function(text){
		
			if($("#showmessage")!=null&&$("#showmessage").length>0)return;
		$("body").append('<div id="showmessage" style="position:fixed;background-color: #F1F1F1;opacity:1;color: black;border-radius: 0.2rem;width:200px;display: none;border:1px solid #e9e9e9;padding:0.5rem;" >'+''+'</div>');
			var windowWidth = document.documentElement.clientWidth
			var windowHeiht = window.screen.height;
			var modelheight=$("#showmessage").height();
				var modelwidth=$("#showmessage").width();
//				/alert(windowWidth);
				$("#showmessage").append("<p style='font-size:12px'>请输入下面图片内的验证码</p>");
				$("#showmessage").append("<div><input type='text' style='height:30px;width:50%;margin:0 ;border:0px red solid;margin-bottom: 5px'></div>");
				$("#showmessage").append("<img src='img/banner.png' style='height:40px;width:50%;margin:0'></br>");
				$("#showmessage").append("<input type='submit' onclick='upMsg.confim()' style='height:30px;width:30%;margin:0' value='确认'></br>");
			var width=windowWidth/2-100;
		
			$("#showmessage").css("top","45%");
			$("#showmessage").css("left",width+"px");
			$("#showmessage").css("display","block");
	},
	
	confim:function(){
		alert(11)
	},
	closeMsg:function(obj){
			//$(obj).css("display","none");
			if($(obj).length>0)
			$(obj).remove()
	}
}

function pop_up(text,reback){
	window.clearInterval();
	var times=$("#upmessage").css("display");
  if(!text)text="！";
	upMsg.openMsg(text);
     if(times!="block"){
	setTimeout(function () {
     upMsg.closeMsg($('#upmessage'));  },"2000");
         if(reback)reback();
		}
}
function pop_up_pos(text,reback,top){
    window.clearInterval();
    var times=$("#upmessage").css("display");
    if(!text)text="！";
    upMsg.openMsgtoPos(text,top);
    if(times!="block"){
        setTimeout(function () {
            upMsg.closeMsg($('#upmessage'));

        },"2000");
        if(reback)reback();
    }
}

function pop_up1(text){ 
	window.clearInterval();
	var times=$("#showmessage").css("display");
  if(!text)text="！";
 upMsg.alertMsg(text);
     if(times!="block"){
	setTimeout("upMsg.closeMsg($('#showmessage'))","2000"); 
		}
}

